package CtrLayer;

import java.util.ArrayList;

import DBLayer.DBBankAccount;
import DBLayer.IFDBBankAccount;
import ModelLayer.BankAccount;

public class CtrBankAccount {
	
	private IFDBBankAccount dbBankAccount;
	
	public CtrBankAccount(){
		dbBankAccount = DBBankAccount.getInstance();
	}
	
	public BankAccount getBankAccount_byAccountNo(String accountNo){
		return dbBankAccount.getBankAccount_byAccountNo(accountNo);
	}
	
	public BankAccount getBankAccount_byBranchCode(String branchCode){
		return dbBankAccount.getBankAccount_byBranchCode(branchCode);
	}
	
	public BankAccount getBankAccount_byAccountName(String accountName){
		return dbBankAccount.getBankAccount_byAccountName(accountName);
	}
	
	public BankAccount getBankAccount_byBankName(String bankName) {
		return dbBankAccount.getBankAccount_byBankName(bankName);
	}
	
	public int insert(String accountName,String accountNo,String bankName,String branchCode){
		return dbBankAccount.insert(new BankAccount(accountNo,accountName,bankName,branchCode));
	}
	
	public int update(String accountName,String accountNo,String bankName,String branchCode){
		return dbBankAccount.update(new BankAccount(accountNo,accountName,bankName,branchCode));
	}
	
	public int delete(String accountNo){
		return dbBankAccount.delete(accountNo);
	}
	
	public ArrayList<BankAccount> getAll(){
		return dbBankAccount.getAll();
	}
	
	public BankAccount getBankAccount(String accountNo){
		return dbBankAccount.getBankAccount(accountNo);
	}

	
	
}
